import 'package:dio/dio.dart';

import '../util.dart';
import 'net_exception.dart';

class NetErrorInterceptor extends Interceptor {
  @override
  void onError(DioError err, ErrorInterceptorHandler handler) {
    NetException exception = NetException.create(err);
    Get.log('DioError====: ${exception.toString()}');
    if (Hud.isShow) {
      Hud.dismiss();
    }

    super.onError(err, handler);
  }
}
